Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: Don't copy xattrs for devicetree #3323

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Oct 18, 2024

xref: coreos/fedora-coreos-tracker#1808

For the kernel/initramfs that we copy to /boot
we use an explicit relabeling today, ignoring the source SELinux
context.

When we added handling for devicetree it reuse the copy_dir_recurse
we have for etc handling, and that copied the source xattrs.

Let's ensure that the devicetree is also boot_t by not copying
xattrs and relying on the default labeling.

@cgwalters
Copy link
Member Author

Only compile tested so far

xref: coreos/fedora-coreos-tracker#1808

For the kernel/initramfs that we copy to `/boot`
we use an explicit relabeling today, ignoring the source SELinux
context.

When we added handling for devicetree it reuse the `copy_dir_recurse`
we have for `etc` handling, and that copied the source xattrs.

Let's ensure that the devicetree is also `boot_t` by *not* copying
xattrs and relying on the default labeling.

Signed-off-by: Colin Walters <[email protected]>
@HuijingHei
Copy link
Collaborator

Do testing on aarch64 with this patch, after finalize-staged, the /boot/ostree/fedora-coreos-*/dtb are labeled with boot_t.

with the patch:

$ sudo /usr/bin/ostree admin finalize-staged
$ sudo restorecon -vnr /boot/ostree/

without this patch:

$ sudo /usr/bin/ostree admin finalize-staged
$ sudo restorecon -vnr /boot/ostree/ | wc -l
1866

Copy link
Collaborator

@HuijingHei HuijingHei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for working on this.

@cgwalters cgwalters merged commit 3625130 into ostreedev:main Oct 21, 2024
26 checks passed
HuijingHei added a commit to HuijingHei/ostree that referenced this pull request Oct 31, 2024
xref to coreos/fedora-coreos-tracker#1808

PR ostreedev#3323 fixes the new
deployment, but keep the incorrect selinux label for the old deplyment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants